package com.financing.wap.dao.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.financing.wap.common.SqlName;
import com.financing.wap.dao.IProjectCompanyDao;
import com.financing.wap.dto.ProductDTO;
import com.financing.wap.dto.ProjectCommentsDTO;
import com.financing.wap.dto.ProjectCompanyDTO;

@SuppressWarnings({ "unchecked", "deprecation" })
@Repository("projectCompanyDaoImpl")
public class ProjectCompanyDaoImpl extends BaseDaoImpl<ProjectCompanyDTO, Integer> implements IProjectCompanyDao{

	@Override
	public Class<ProjectCompanyDTO> getEntityClass() {
		return ProjectCompanyDTO.class;
	}


	@Override
	public List<ProjectCompanyDTO> getProjectCompanyList (
			ProjectCompanyDTO projectCompanyDTO) throws SQLException{
		return this.sqlMapClientTemplate.queryForList(SqlName.QUERY_PROJECT_COMPANY, projectCompanyDTO);
	}

	@Override
	public ProjectCompanyDTO getProjectCompany(Integer id) throws SQLException {
		return (ProjectCompanyDTO) this.sqlMapClientTemplate.queryForObject(SqlName.QUERY_PROJECT_COMPANY_INFO,id);
	}
	
	@Override
	public List<ProductDTO> getCompanyProductList(Map<String,Object> queryParams) throws SQLException{
		List<ProductDTO> queryForList = this.sqlMapClientTemplate.queryForList(SqlName.QUERY_COMPANY_PRODCUTLIST, queryParams);
		return queryForList;
	}
	@Override
	public int getCompanyProductListCount(Map<String,Object> queryParams) {
		return (Integer) super.sqlMapClientTemplate.queryForObject( SqlName.QUERY_COMPANY_PRODCUTLIST_COUNT, queryParams);
	}
}
